﻿<UserControl x:Class="Gallery.DragAndDrop.CanvasSample.CanvasSampleView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Gallery.DragAndDrop.CanvasSample"
             xmlns:apexMVVM="clr-namespace:Apex.MVVM;assembly=Apex.Silverlight"
             xmlns:apexControls="clr-namespace:Apex.Controls;assembly=Apex.Silverlight"
             xmlns:dragAndDrop="clr-namespace:Apex.DragAndDrop;assembly=Apex.Silverlight"
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="600">
    
    <!-- The View creates its own ViewModel, so set the ViewModel 
    to a new instance of the ViewModel class. -->
    <UserControl.DataContext>
        <local:CanvasSampleViewModel x:Name="viewModel" />
    </UserControl.DataContext>
    
        <dragAndDrop:DragAndDropHost x:Name="dragAndDropHost">
            <Canvas
            dragAndDrop:DragAndDrop.IsDragSource="True"
            dragAndDrop:DragAndDrop.IsDropTarget="True">
                <Ellipse Width="50" Height="50" Fill="Red" Stroke="Black" StrokeThickness="2"
                     dragAndDrop:DragAndDrop.IsDraggable="True" />
                <Ellipse Width="50" Height="50" Canvas.Left="100" Canvas.Top="60" Fill="Green" Stroke="Black" StrokeThickness="2"
                     dragAndDrop:DragAndDrop.IsDraggable="True" />

                <Rectangle Width="100" Height="20" Canvas.Left="20" Canvas.Top="160" Fill="Yellow" Stroke="Black" StrokeThickness="2"
                     dragAndDrop:DragAndDrop.IsDraggable="True" />
            </Canvas>
        </dragAndDrop:DragAndDropHost>
</UserControl>
